package cn.itcast.spring.demo8;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component(value="people2")
public class People {
	
	@Autowired
	@Qualifier(value="cat")
	private Cat cat;
	
	@Resource(name="cat")
	private Cat myCat;
	
	
	@Value("张三")
	private String peopleName;
	
	private int age;
	
	private String address;

	public String getPeopleName() {
		return peopleName;
	}

	public void setPeopleName(String peopleName) {
		this.peopleName = peopleName;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}
	
	
	
	
	
	public Cat getCat() {
		return cat;
	}

	public void setCat(Cat cat) {
		this.cat = cat;
	}

	public void eat(){
		System.out.println("开始吃饭啦");
	}
	

}
